<?php

namespace app\common\model;;


class TransferRecordModel extends BaseModel{

	protected $table = 'tp_transfer_record';

	/*
	添加记录
	 */
	public function addRecord($uid,$to_uid,$wid,$amount,$left_amount,$fee_wid,$fee){
		// if ($wid == $fee_wid) {
		// 	$left_amount = $amount-$fee;
		// } else {
		// 	$left_amount = $amount;
		// }
		$data = [
			'uid'=>$uid,
			'to_uid'=>$to_uid,
			'wid'=>$wid,
			'left_amount'=>$left_amount,
			'amount'=>$amount,
			'fee'=>$fee,
			
			'date'=>$this->getDate(),
		];
		$res = $this->insertGetId($data);
		return $res;
	}
}